import request from "../utils/request";

//添加到购物车、修改购物车的数量
export const reqAddToCart = (skuId, skuNum) => {
	return request({
		method: "POST",
		url: `/cart/addToCart/${skuId}/${skuNum}`
	});
};

//获取购物车列表
export const reqGetCartList = () => {
	return request({
		method: "GET",
		url: "/cart/cartList"
	});
};

//更新购物车的选中状态
export const reqUpdateCart = (skuID, isChecked) => {
	return request({
		method: "GET",
		url: `/cart/checkCart/${skuID}/${isChecked}`
	});
};

//删除购物车的商品
export const reqDeleteCart = (skuId) => {
	return request({
		method: "DELETE",
		url: `/cart/deleteCart/${skuId}`
	});
};
